<?php


namespace App\Services;


use App\Models\Course;
use App\Models\Expert;

class ExpertService extends BaseService
{
    /**
     * 获取专家列表
     * @return
     */
    public function list($page,$limit,$sort,$order,$name) {
        $query = Expert::query();
        if(!empty($name)){
            $query->where('name','like',"%$name%");
        }
        return $query->orderBy($sort,$order)->paginate($limit, ['*'], 'page', $page);
    }

    /**
     * 获取专家信息
     * @return
     */
    public function info($id) {
        $query = Expert::query();
        return $query->where('id',$id)->get();
    }
}
